var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (t, o) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, t) {
              e.__proto__ = t;
            }) ||
          function (e, t) {
            for (var o in t)
              Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
          })(t, o);
      };
      return function (t, o) {
        function n() {
          this.constructor = t;
        }
        if ("function" != typeof o && null !== o)
          throw new TypeError(
            "Class extends value " + String(o) + " is not a constructor or null"
          );
        e(t, o),
          (t.prototype =
            null === o
              ? Object.create(o)
              : ((n.prototype = o.prototype), new n()));
      };
    })(),
  MoneyBankView = (function (e) {
    function t() {
      var t = e.call(this) || this;
      return (
        (t.maxStorgeSliverValue = 0),
        (t.maxStorgeGolderValue = 0),
        (t.qianzhuangLoadFn = {
          caller: t,
          code: 1450,
          method: function (e) {
            if (0 == e.code) {
              if (
                (0 == e.data.gold
                  ? ((t.lbl_money_gold.text = "0"), (t.maxGolderValue = 0))
                  : ((t.lbl_money_gold.text = e.data.gold),
                    (t.maxGolderValue = e.data.gold)),
                0 == e.money
                  ? ((t.lbl_money_slider.text = "0"), (t.maxSliderValue = 0))
                  : ((t.lbl_money_slider.text = e.data.money),
                    (t.maxSliderValue = e.data.money)),
                e.more)
              ) {
                var o = e.more;
                (t.label_tuiguangyuan.visible = !0),
                  (t.lab_today_gold_total.text = o.todayGold),
                  (t.lab_today_sliver_total.text = o.todaySilver),
                  (t.lab_change_glod_total.text = o.changeGold),
                  (t.lab_change_sliver_total.text = o.changeSilver);
              }
              (t.lbl_storage_gold.text = e.data.balanceGold),
                (t.lbl_storge_sliverq.text = e.data.balanceMoney),
                (t.maxStorgeGolderValue = e.data.balanceGold),
                (t.maxStorgeSliverValue = e.data.balanceMoney),
                Laya.stage.event("HomePageView", {
                  code: "moeny",
                  data: e.data,
                });
            } else ToastView.toastView(e.msg);
          },
        }),
        t.bankPeBack.on(Laya.Event.CLICK, t, t.onPreBack),
        t.btn_silverIn.on(Laya.Event.CLICK, t, t.onSliverInFn),
        t.btn_silverOut.on(Laya.Event.CLICK, t, t.onSilverOutFn),
        t.btn_glodIn.on(Laya.Event.CLICK, t, t.onGlodInFn),
        t.btn_glodOut.on(Laya.Event.CLICK, t, t.onGlodOutFn),
        t.btn_buyGlodes.on(Laya.Event.CLICK, t, t.onBuyGlodesFn),
        t.btn_puracse.on(Laya.Event.CLICK, t, t.onPuraseFn),
        WebSocketService.addListener(t.qianzhuangLoadFn, !0),
        t
      );
    }
    return (
      __extends(t, e),
      (t.openView = function () {
        return (
          null == this.moneyBankVC && (this.moneyBankVC = new t()),
          (this.moneyBankVC.label_tuiguangyuan.visible = !1),
          WebSocketService.send({ c: 1450, d: { pageNum: 0 } }),
          this.moneyBankVC
        );
      }),
      (t.prototype.onSliverInFn = function () {
        this.onStorageAction("银币存款", this.maxSliderValue);
      }),
      (t.prototype.onSilverOutFn = function () {
        this.onStorageAction("银币取款", this.maxStorgeSliverValue);
      }),
      (t.prototype.onGlodInFn = function () {
        this.onStorageAction("金币存款", this.maxGolderValue);
      }),
      (t.prototype.onGlodOutFn = function () {
        this.onStorageAction("金币取款", this.maxStorgeGolderValue);
      }),
      (t.prototype.onBuyGlodesFn = function () {
        var e = TradeView.openView();
        e.pos(0, 35), Laya.stage.addChild(e);
      }),
      (t.prototype.onPuraseFn = function () {
        var e = PuranceView.openView();
        e.pos(0, 40), Laya.stage.addChild(e);
      }),
      (t.prototype.onStorageAction = function (e, t) {
        StorageMoneyDialog.showStorageView(e, t);
      }),
      (t.prototype.onPreBack = function () {
        this.removeSelf();
      }),
      t
    );
  })(ui.MoneyBankController.MoneyBankViewUI);
